<tr class="ng-table-sort-header">
  <th title="{{$column.headerTitle(this)}}"
    ng-repeat="$column in $columns"
    ng-class="{
      'sortable': $column.sortable(this),
      'sort-asc': params.sorting()[$column.sortable(this)]=='asc',
      'sort-desc': params.sorting()[$column.sortable(this)]=='desc'
    }"
    ng-click="sortBy($column, $event)"
    ng-if="$column.show(this)"
    width="{{$column.field == 'selector' ? '1' : ''}}"
    ng-init="template = $column.headerTemplateURL(this)"
    class="header {{$column.class(this)}}">
    <div ng-if="!template"
      class="ng-table-header"
      ng-class="{'sort-indicator': params.settings().sortingIndicator == 'div'}">
      <span ng-if="$column.titleRender"
        ng-compile="$column.titleRender"
        ng-class="{'sort-indicator': params.settings().sortingIndicator == 'span'}"></span>
      <span ng-if="!$column.titleRender"
        ng-bind-html="$column.title()"
        ng-class="{'sort-indicator': params.settings().sortingIndicator == 'span'}"></span>
    </div>
    <div ng-if="template"
      ng-include="template"></div>
  </th>
</tr>
